package com.caimiao.miao.interfaces;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.WindowManager;

import com.caimiao.miao.library.utils.PixelUtil;

public abstract class DialogActivity<P extends IBasePresenter> extends BaseActivity<P> {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initDialog();
    }

    protected void initDialog() {
        //窗口设置
        setFinishOnTouchOutside(false);
        WindowManager.LayoutParams params = getWindow().getAttributes();
        params.height = Math.round(PixelUtil.getScreenHeight(this) * 0.5f);
        params.width = Math.round(PixelUtil.getScreenWidth(this) * 0.5f);
        params.alpha = 1.0f;
        params.dimAmount = 0.5f;
        getWindow().setAttributes(params);
    }
}
